#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
int main() 
{
	double a,b;
	char x;
    cout<<"请输入要选择的算法"<<endl;
	cin>>x;
	while(x!='+'&&x!='-'&&x!='*'&&x!='/')
	{
	    cout<<"请输入正确的运算符号"<<endl;
	    cin>>x;
	}
    cout<<"请输入第一个数字" <<endl;
	cin>>a;
	cout<<"请输入第二个数字"<<endl;
	cin>>b; 
	
	if(x=='+')
	{
		cout<<setiosflags(ios::fixed)<<setprecision(2)<<"a+b="<<a+b<<endl;
	}
	else if(x=='-')
	{
		cout<<setiosflags(ios::fixed)<<setprecision(2)<<"a-b="<<a-b<<endl;
    }
	else if(x=='*')
	{
		cout<<setiosflags(ios::fixed)<<setprecision(2)<<"a*b="<<a*b<<endl;
    }
    else if(x=='/')
	{
		while(b==0){
			cout<<"请输入不为0的除数"<<endl;
			cin>>b; 	
		}
		cout<<setiosflags(ios::fixed)<<setprecision(2)<<"a/b="<<a/b<<endl;
    }
} 